<?php require_once 'header.php';?>    <!-- DataTables Responsive CSS -->
    <link href="sb2/vendor/datatables-responsive/dataTables.responsive.css" rel="stylesheet">
        <!-- Page Content -->
        <div id="page-wrapper">
            <div class="container-fluid">
                <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                        	<?php echo XXF_BACK?>
                            组名：【<?php echo $gname;?>】<br>
                            <select id="uid">
                                	<option>选择人员</option>
                            	<?php
                                	foreach ($result as $row){
                                	?>
                                    <option value="<?php echo $row['id']?>"><?php echo $row['id']?><?php echo $row['realname']?>(<?php echo $row['mphone']?>)</option>
                                	<?php 
                                	}
                                	?>
                            </select>
                            <input type="button" id="add" value="添加" onclick="add()">
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
                                <thead>
                                    <tr>
                                        <th>姓名</th>
                                        <th>手机</th>
                                        <th>职务</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <?php
                                	$i=0;
                                	foreach ($guser as $row){$i++;
                                	?>
                                    <tr class="<?php echo $i%2==0?"even":"odd";?> gradeA">
                                        <td><?php echo $row['realname'];?></td>
                                        <td><?php echo $row['mphone'];?></td>
                                        <td><?php echo $row['zhiwu'];?></td>
                                        <td><a href="javascript:del(<?php echo $row['ugid']?>)">删除</a></td>
                                    </tr>
                                	<?php 
                                	}
                                	?>
                                </tbody>
                            </table>
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
             </div>
        </div>
        <!-- /#page-wrapper -->
        <!-- DataTables JavaScript -->
<?php require_once 'bottom.php';?>
    <script src="sb2/vendor/datatables/js/jquery.dataTables.js"></script>
    <script src="sb2/vendor/datatables-plugins/dataTables.bootstrap.min.js"></script>
    <script src="sb2/vendor/datatables-responsive/dataTables.responsive.js"></script>
    <script>
    $(document).ready(function() {
        $('#dataTables-example').DataTable({
            responsive: true,
            "aaSorting": [[ 0, "asc" ]]
        });
    });
    function add(){
		$.xpost("usersysgroup",{
			type:"adduser",
			uid:$("#uid").val(),
			gid:<?php echo $id?>
		},function(data){
			window.location.reload();
		});
    }
    function del(id){
		$.xdel("user_groupx",id);
    }
    </script>